local jingqi = fk.CreateSkill{
  name = "wk_heg__jingqi",
}

Fk:loadTranslationTable{
  ["wk_heg__jingqi"] = "经奇",
  [":wk_heg__jingqi"] = "每回合限一次，当一名角色造成属性伤害或横置后，你可与当前回合角色各摸一张牌。",

  ["$wk_heg__jingqi1"] = "好，很好，非常好！",
  ["$wk_heg__jingqi2"] = "您的话也很好！",
}

jingqi:addEffect(fk.Damage,{
  anim_type = "drawcard",
  can_trigger = function(self, event, target, player, data)
  if not (player:hasSkill(jingqi.name) and player:usedSkillTimes(jingqi.name, Player.HistoryTurn) == 0) then return false end
      return data.damageType ~= fk.NormalDamage
  end,
  on_use = function(self, event, target, player, data)
    if not player.room.current.dead then
      player.room.current:drawCards(1, jingqi.name)
    end
    if not player.dead and player ~= player.room.current then
      player:drawCards(1, jingqi.name)
    end
  end,
})

jingqi:addEffect(fk.ChainStateChanged,{
  can_trigger = function(self, event, target, player, data)
      if not (player:hasSkill(jingqi.name) and player:usedSkillTimes(jingqi.name, Player.HistoryTurn) == 0) then return false end
        return target.chained
    end,
  on_use = function(self, event, target, player, data)
    if not player.room.current.dead then
      player.room.current:drawCards(1, jingqi.name)
    end
    if not player.dead and player ~= player.room.current then
      player:drawCards(1, jingqi.name)
    end
  end,
})

return jingqi